package com.ruoyi.quartz.task;

import com.ruoyi.common.utils.spring.SpringUtils;

import com.ruoyi.hr.service.changemanage.depchange.DepChangeService;
import com.ruoyi.hr.service.changemanage.internshipchangejust.InternshipChangeJustService;
import com.ruoyi.hr.service.changemanage.trialchangejust.TrialChangeJustService;
import com.ruoyi.hr.service.entryexitmanage.entrymanage.NewEmpRegisterService;
import com.ruoyi.hr.service.entryexitmanage.quitmanage.QuitManageService;
import org.springframework.stereotype.Component;


/**
 * 定时任务调度测试
 *
 * @author zeo
 */

@Component("HrTask")
public class HrTask {

    private NewEmpRegisterService newEmpRegisterService = (NewEmpRegisterService) SpringUtils.getBean(NewEmpRegisterService.class);
    private QuitManageService quitManageService = (QuitManageService) SpringUtils.getBean(QuitManageService.class);
    private InternshipChangeJustService internshipChangeJustService = (InternshipChangeJustService) SpringUtils.getBean(InternshipChangeJustService.class);
    private TrialChangeJustService trialChangeJustService = (TrialChangeJustService) SpringUtils.getBean(TrialChangeJustService.class);
    private DepChangeService depChangeService = (DepChangeService) SpringUtils.getBean(DepChangeService.class);

    /**
     * 入离转调等录入未执行处理的员工将在2个月后自动删除 每日凌晨1点执行
     */
    public void removeInwardOutwardModulation(){
        //入
        newEmpRegisterService.removeLargeTwoMonths();
        //离
        quitManageService.removeLargeTwoMonths();
        //转
        //实习转正登记
        internshipChangeJustService.removeLargeTwoMonths();
        //试用转正登记
        trialChangeJustService.removeLargeTwoMonths();
        //调
        depChangeService.removeLargeTwoMonths();
    }
}
